package com.ljx.thread.thread04;

/**
 * @author LJX
 * @Description: TODO
 * @Date: 2022/11/1 16:28
 * @Version 1.0
 */
public class GirlThread extends Thread{
	private DeadLockChop deadLockChop;
	public GirlThread(DeadLockChop deadLockChop){
		this.deadLockChop=deadLockChop;
	}



	@Override
	public void run() {
		synchronized (deadLockChop.getRightChopsticks()){
			System.out.println("女孩获取右筷子");
			synchronized (deadLockChop.getLeftChopsticks()){
				System.out.println("女孩获取左筷子");
			}
		}
	}
}
